package com.atguigu.gmall.payment.config;

import com.atguigu.gmall.payment.intercepter.LoginIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Autowired
    LoginIntercepter loginIntercepter;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器，并配置拦截器的相关路径
        registry.addInterceptor(loginIntercepter).addPathPatterns("/**").excludePathPatterns("/pay/**");
    }
}
